Half-duplex communication control method

ABSTRACT

A half-duplex communication control method according to this invention is constructed so that in a half-duplex communication control method in which two devices connected by two signal lines are had and half-duplex communication in one-to-one correspondence is conducted, the first device outputs a sending request output for providing notification of a state of a communication request to the second device as a sending request signal using an open collector buffer and also turns back its sending request output inside the self device to check a communicable state as a sending request input and also in the case of being receivable with respect to the sending request signal sent from the opponent device, the second device outputs a sending permission output for providing notification of a communicable state to the first device as a sending permission signal using an open collector buffer and also turns back its sending permission output inside the self device to check a communicable state as a sending permission input, and since each the device decides sending permission by an output from the opponent device, sending is performed after checking whether the opponent device is receivable, so that both the devices are prevented from starting sending simultaneously.

TECHNICAL FIELD

This invention relates to a control method of half-duplex communicationin one-to-one correspondence using a cable, and relates to acommunication control method for preventing both two devices fromstarting sending simultaneously.

BACKGROUND ART

An operation of devices for conducting conventional half-duplexcommunication will be described below.

The device outputs a sending request signal at the time of startingsending and when the sending request signal is outputted, the sendingrequest signal is inputted to a sending permission signal of the selfdevice, so that it is decided that sending can be performed, and datasending is started at once.

However, in the operation described above, two devices runasynchronously, so that sending may be started simultaneously from bothof the devices. In this case, a carrier detection signal is inputted toboth of the two devices after starting the sending, and at this time,either device suspends the sending by setting of a priority preset.

The device, which suspends the sending, releases the sending requestsignal and receives data sent from the opponent device and after thecompletion of the receiving, the device again outputs a sending requestsignal and resumes the sending.

The device, which wants to start sending, outputs a sending requestsignal, and its signal is inputted as a receiving-request signal of theopponent device.

When the receiving request signal is inputted, a device of the receivingside outputs a receivable signal since receiving can be performed unlessthe device of the receiving side is in sending, and its signal isinputted as a sending permission signal of a device of the sending side.

The device of the sending side starts sending of data after the sendingpermission signal is inputted, so that the two devices can be preventedfrom starting sending simultaneously by stopping an output of thereceivable signal even when the sending request signals are outputtedfrom two ways.

Also, as another conventional example, as shown in JP-A-60-41844 as oneexample, there is an example of making an error determination when areceivable signal (permission signal) is not inputted within apredetermined time after a sending request signal (channel acquisitionrequest signal) is outputted from a self device.

In the conventional half-duplex communication control method, as smallas two control signal lines necessary inside a cable will suffice, but asending request signal output is used as a sending permission signalinput of the self device, so that there was a problem that when sendingrequest signals are simultaneously outputted from the two devices, itmay be decided that both the two devices are capable of sending andsending may be started simultaneously from the two devices.

Also, as an operation at the time of sending simultaneously from the twodevices, setting of “sending continuation” is previously made in onedevice and setting of “sending suspension” is made in the other deviceand thereby at the time of simultaneous sending, sending from the devicein which the setting of “sending continuation” is made can be performed,but there was a problem that a setting mistake of the case of setting“sending suspension” or the case of setting “sending continuation” inboth the devices cannot be detected.

Also, in the case of another conventional example described above,sending is started after the device of the sending side checks a signalas to whether the opponent device is receivable, so that sending is notstarted simultaneously from the two devices, but there were problemsthat since it is necessary to use four signal lines inside a cable as acontrol signal, the cable thickens and wiring of the cable becomes worseor a price of the cable increases.

Further, there were problems that since a control signal line ismonitored by H/W, a complicated circuit for monitoring becomes necessaryand a size of a communication device becomes large or a price of thecommunication device increases.

Therefore, this invention is implemented to solve the problems describedabove, and an object of the invention is to provide a half-duplexcommunication control method in which both devices are prevented fromstarting sending simultaneously and also previous settings of a priorityetc. are unnecessary.

DISCLOSURE OF THE INVENTION

This invention provides a half-duplex communication control methodconstructed so that in a half-duplex communication control method inwhich a first device and a second device connected to this first deviceby two signal lines are had and each of the two devices notifies theopponent device of a state as to whether the self device is communicableand half-duplex communication in one-to-one correspondence is conducted,the first device outputs a sending request output for providingnotification of a state of a communication request from the first deviceto the second device as a sending request signal using an open collectorbuffer and also turns back its sending request output inside the firstdevice to check a communicable state as a sending request input insidethe first device and also in the case that the second device isreceivable with respect to the sending request signal sent from thefirst device, the second device outputs a sending permission output forproviding notification of a communicable state from the second device tothe first device as a sending permission signal using an open collectorbuffer and also turns back its sending permission output inside thesecond device to check a communicable state as a sending permissioninput inside the second device.

Therefore, each the device is constructed so as to decide sendingpermission by an output from the opponent device, so that sending afterchecking whether the opponent device is receivable or not can beperformed, and both the devices can be prevented from starting sendingsimultaneously.

Also, this invention randomly determines time respectively varying withrespect to two devices by a program of a microcomputer with regard totime which elapses before outputting another sending request output inthe case of outputting sending request outputs simultaneously from thetwo devices.

Therefore, the time which elapses before each the device again outputsthe sending request output is varied in the two devices and thereby, astate in which the simultaneous sending request outputs of the twodevices compete and communication cannot be conducted can be preventedfrom continuing.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing wiring and a configuration of devicesfor conducting half-duplex communication according to this invention.

FIG. 2 is a flowchart showing an operation of control signals at thetime of normal communication according to this invention.

FIG. 3 is a flowchart showing an operation of control signals at thetime of communication competition according to this invention.

BEST MODE FOR CARRYING OUT THE INVENTION First Embodiment

A preferred embodiment of this invention will be described using thedrawings.

FIG. 1 is a block diagram showing wiring and a configuration of devicesfor conducting half-duplex communication using a cable in this inventionand in the same figure, a sending request output (REQOH) of eachcommunication device is a signal in which H is outputted at the time ofsending from the self device to the opponent device and a sendingrequest input (REQIH) is a signal in which H is inputted at the time ofsending from the opponent device to the self device or the time ofsending from the self device to the opponent device.

In a manner similar to the above, a sending permission output (ACKOH) ofeach the device is a signal in which H is outputted at the time ofpermitting sending from the opponent device to the self device and asending permission input (ACKIH) is a signal in which H is inputted atthe time of permitting sending from the opponent device to the selfdevice or the time of permitting sending from the self device to theopponent device.

REQ is a signal inside a cable for making connection between the twocommunication devices, and is a signal which becomes L when at leasteither device shifts the sending request output to H, and is a signalfor connecting signals passing through buffers of open collectors fromthe sending request outputs of each of the devices. When both the twodevices shift the sending request outputs to L, an output of the bufferbecomes Z (high impedance) but the REQ becomes H by a pull-up resistorinside the communication device.

In a manner similar to the above, ACK is a signal inside the cable formaking connection between the two communication devices, and is a signalwhich becomes L when at least either device shifts the sendingpermission output to H, and is a signal for connecting signals passingthrough buffers of open collectors from the sending permission outputsof each of the devices. When both the two devices shift the sendingpermission outputs to L, the ACK becomes H by a pull-up resistor insidethe communication device.

Next, an operation of the case of this embodiment will be describedbelow with reference to flowcharts of FIGS. 2 and 3.

A sending request output and a sending permission output of each thedevice are normally L, and REQ and ACK become H by pull-up resistorsinside the devices since outputs of buffers of open collectors are Z.

In the above state, the REQ and ACK are H, so that L is inputted to asending request input and a sending permission input by inverterbuffers.

When a communication device 1 sends to a communication device 2, thecommunication device 1 first shifts the sending request output to H(S1). As a result of this, REQ becomes L, so that H is inputted to thesending request inputs of the communication device 1 and thecommunication device 2 (S2, S100).

The device in which H is inputted to the sending request input decideswhether the device is in the sending side or the receiving side by astate of the sending request output of the self device. When H has beenoutputted to the sending request output which is a state of thecommunication device 1, the device is in a sending permission request(sending side) with respect to the opponent device, so that there isnothing to perform, but when L has been outputted to the sending requestoutput which is a state of the communication device 2, the device is ina sending permission request (receiving side) from the opponent, so thatH is outputted to the sending permission output when the self device isreceivable (S101, S102).

The receiving side communication device outputs H to the sendingpermission output and thereby ACK becomes L, so that H is inputted tothe sending permission inputs of the communication device 1 and thecommunication device 2 (S3, S103).

When H is inputted to the sending permission input, the sending sidecommunication device which outputs H to the sending request outputdecides that the opponent device is receivable, and starts sending ofdata (S4). Also, the receiving side communication device startsreceiving of data (S104).

When the sending is completed, the communication device of the sendingside shifts the sending request output to which H has been outputted toL (S5). As a result of this, REQ becomes H and the sending requestinputs in the communication devices of the sending side and thereceiving side become L (S6, S105).

In the communication device of the receiving side, the sending requestinput to which H has been inputted changes to L and thereby it isdecided that the sending from the opponent device is completed (S106),and the sending permission output to which H has been outputted isshifted to L (S107). As a result of this, ACK becomes H and the sendingpermission inputs in the communication devices of the sending side andthe receiving side become L (S7, S108) and the devices return to aninitial state.

When the sending permission input does not become H for a certain timein a state in which the sending side device has outputted H to thesending request output, it is decided that the opponent device is notreceivable, and the sending side device returns the sending requestoutput to L once and after a while, an operation of a sending request isagain performed.

When H is outputted to sending request outputs simultaneously from boththe devices (S10, S110), sending request inputs become H in both thedevices, but since H is outputted to the sending request outputs, it isdecided that the devices are in a sending permission request (sendingside), and H is not outputted to sending permission outputs, so thatboth the devices decide that the opponent device is not receivable bythe operation described above, and the sending request outputs arereturned to L (S12, S112) and after a while, an operation of a sendingrequest is again performed (S14, S114).

By directly controlling the sending request output through amicrocomputer bus from a microcomputer, time which elapses before thedevice which has returned the sending request output to L again shiftsthe sending request output to H can be determined by the microcomputer.As a result of this, the time which elapses before each the device againoutputs the sending request output is randomly determined by a programof the microcomputer and subsequently, a state in which the sendingrequest outputs of the two devices compete simultaneously andcommunication cannot be conducted is prevented from continuing.

As described above, according to this invention, each the device isconstructed so as to decide sending permission by an output from theopponent device, so that sending after checking whether the opponentdevice is receivable or not can be performed, and a communication errordue to a start of simultaneous sending from both the devices can beprevented.

INDUSTRIAL APPLICABILITY

As described above, a half-duplex communication control method accordingto this invention is suitable for use in communication of FA devices andso on.

1. A half-duplex communication control method in which a first deviceand a second device are connected by two signal lines and each of thefirst device and second device notifies the other device of a staterelated to whether each device is communicable, and half duplexcommunication in one-to-one correspondence is conducted, said methodcomprising: the first device outputting a sending request output forproviding notification of a state of a communication request from thefirst device to the second device as a sending request signal using anopen collector buffer and also turning back said sending request outputinside the first device to check a communicable state inside the firstdevice, and if the second device is receivable with respect to thesending request signal sent from the first device, the second deviceoutputting a sending permission output for providing notification of acommunicable state from the second device to the first device as asending permission signal using an open collector buffer and alsoturning back said sending permission output inside the second device tocheck a communicable state inside the second device.
 2. A half duplexcommunication control method as defined in claim 1, wherein afteroutputting sending request outputs simultaneously from said first deviceand said second device, respective times of said first device and saidsecond device which elapses before outputting another sending requestoutput vary and are randomly determined by a program of a microcomputer.